{% extends "journal/base.html" %}

{% block main %}
<section>
    <h1>个人信息设置</h1>
    {% if messages %}
    <ul class="messages">
        {% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    
    <form method="post">
        {% csrf_token %}
        <label for="nickname">昵称：
            <input type="text" 
                   name="nickname" 
                   id="nickname" 
                   value="{{ user.nickname }}" 
                   required 
                   placeholder="请输入昵称">
        </label>
        
        <label for="real_name">姓名：
            <input type="text" 
                   name="real_name" 
                   id="real_name" 
                   value="{{ user.real_name }}"
                   placeholder="选填">
        </label>
        
        <label for="phone_number">手机号：
            <input type="tel" 
                   name="phone_number" 
                   id="phone_number" 
                   value="{{ user.phone_number }}" 
                   required
                   pattern="[0-9]{11}"
                   placeholder="请输入11位手机号">
        </label>
        
        <label for="old_password">原密码：
            <input type="password" 
                   name="old_password" 
                   id="old_password" 
                   placeholder="不修改请留空">
        </label>
        
        <label for="new_password">新密码：
            <input type="password" 
                   name="new_password" 
                   id="new_password" 
                   placeholder="不修改请留空">
        </label>
        
        <label for="confirm_password">确认新密码：
            <input type="password" 
                   name="confirm_password" 
                   id="confirm_password" 
                   placeholder="不修改请留空">
        </label>
        
        <button type="submit">保存修改</button>
    </form>
</section>
{% endblock %} 